const Koa = require('koa');

const Router = require('koa-router');
// 实例化Koa
const app = new Koa;
// 实例化Router
const router = new Router();

// 路由分发
router.get('/', (ctx, next) => {
  ctx.body = 'index';
}).get('/cs', (ctx, next) => {
  ctx.body = 'cs';
})

app.use(router.routes()).use(router.allowedMethods()).listen(3030, () => {
  console.log('koa-router');
})